﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
namespace SIMSProject.Views.Ajax.GetCustomer
{
    public partial class GetCustomerUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt16(Request.QueryString["id"].ToString());

                SPListItem item = SPContext.Current.Web.Lists["Customer"].GetItemById(id);
                string result = string.Empty;
                result += item["Name"].ToString() + ";";
                result += item["Address"].ToString() + ";";
                result += item["Phone Number"].ToString() + ";";
                result += item["Tax Code"].ToString() + ";";
                Response.Write(result);
            }
            catch (Exception ex)
            {
                Response.Write(";;;;");
            }
        }
    }
}
